<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>Social Mobile</title>
<script>
var chkNative = true;
</script>
<!-- jQuery and jQuery Mobile -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script	src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>

<script type="text/javascript" src="js/jquery.ui.map.js"></script>
<script type="text/javascript" src="js/infobox.js"></script>
<script type="text/javascript" src="js/markerclusterer.js"></script>

<link rel="stylesheet" href="css/mobile-style.css" />
<script type="text/javascript" src="js/social-mobile.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>

</head>
<body>

	<!-- Home -->
	<div data-theme="a" data-role="page" id="login-mobile-page">
		<div data-role="content">

			<center>
			<img alt="" src="img/logossw.png">
			<br>
			<img src="img/txtssw.png">
			</center>
			<form id="frm-login" action="/social-mobile-web/rest/profile/login"  data-ajax="false">
			<input name="dsLogin" id="dsLogin" placeholder="" value="" type="hidden">
			<input name="dsPassword" id="dsPassword" placeholder="" value="" type="hidden">
			
			</form>
		</div>
	</div>


<script>

loginCookie = $.cookie("login");
pwdCookie = $.cookie("pwd");

/* attach a submit handler to the form */
$("#frm-login").submit(function(event) {
	showLoadingMsg();

	/* stop form from submitting normally */
  event.preventDefault();
 
  /* get some values from elements on the page: */
  var $form = $( this ),
      login = loginCookie,
      pwd = pwdCookie,
      url = $form.attr( 'action' );
 
  /* Send the data using post */
  var posting = $.post( url, { 'dsLogin': login, 'dsPassword': pwd } );
 
  /* Put the results in a div */
  posting.done(function( data ) {
	if (data == "sucess") {
		location.href = "users.html"
	} else {
		location.href = "login.html"
	}
    
  });
});

function enviar() {
	$("#frm-login").submit();
	
}
setTimeout("enviar()", 1000);
</script>
</body>

</html>
